package avicit.bdp.dcs.job.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.bdp.common.dto.api.APIHttpDefinition;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @author mayi
 * API定义
 */
@ApiModel(value = "API接口定义")
@Table(name = "bdp_dcs_api_definition")
public class ApiDefinitionDto extends BaseDTO {

    @Id
    @LogField
    @ApiModelProperty(value = "id", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    @LogField
    @ApiModelProperty(value = "采集任务Id", name = "jobId")
    @FieldRemark(column = "job_id", field = "jobId", name = "采集任务Id")
    @Column(name = "job_id")
    private String jobId;

    @LogField
    @ApiModelProperty(value = "类型ID", name = "typeId")
    @FieldRemark(column = "type_id", field = "typeId", name = "类型ID")
    @javax.persistence.Id
    @Column(name = "type_id")
    private String typeId;

    @LogField
    @ApiModelProperty(value = "接口名称", name = "name")
    @FieldRemark(column = "name", field = "name", name = "接口名称")
    @Column(name = "name")
    private String name;

    @LogField
    @ApiModelProperty(value = "接口定义JSON", name = "definitionJson")
    @FieldRemark(column = "definition_json", field = "definitionJson", name = "接口定义JSON")
    @Column(name = "definition_json")
    private String definitionJson;

    @LogField
    @ApiModelProperty(value = "接口描述", name = "description")
    @FieldRemark(column = "description", field = "description", name = "接口描述")
    @Column(name = "description")
    private String description;

    @Transient
    private APIHttpDefinition apiHttpDefinition;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDefinitionJson() {
        return definitionJson;
    }

    public void setDefinitionJson(String definitionJson) {
        this.definitionJson = definitionJson;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public APIHttpDefinition getApiHttpDefinition() {
        return apiHttpDefinition;
    }

    public void setApiHttpDefinition(APIHttpDefinition apiHttpDefinition) {
        this.apiHttpDefinition = apiHttpDefinition;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    @Override
    public String toString() {
        return "ApiDefinitionDto{" +
                "id='" + id + '\'' +
                ", jobId='" + jobId + '\'' +
                ", typeId='" + typeId + '\'' +
                ", name='" + name + '\'' +
                ", definitionJson='" + definitionJson + '\'' +
                ", description='" + description + '\'' +
                ", apiHttpDefinition=" + apiHttpDefinition +
                '}';
    }
}
